home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: newbie question concerning fread
- Date: Tue, 27 Feb 96 20:31:58 GMT
- Organization: none
- Distribution: inet
- Message-ID: <825453118snz@genesis.demon.co.uk>
- References: <rblayney.824643669@extro> <4gqejmINNh5@keats.ugrad.cs.ubc.ca>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4gqejmINNh5@keats.ugrad.cs.ubc.ca>
- c2a192@ugrad.cs.ubc.ca "Kazimir Kylheku" writes:
-
- >The two are equivalent, since in C, an "E1[E2]", where E1 and E2 are
- >expressions, is the same as *((E1) + (E2)). One neat effect of this definition
- >is that if you have an array called 'a', and an index called 'i', you can refer
- >to the ith element as either a[i] or i[a].
-
- But certainly not [a]i or [i]a
-
- >Hence both of these constructs give the letter 'x':
-
- >
- > char x = "abcx"[3];
- > char x = [3]"abcx"; /* This is a syntax error */
- > char x = ["abcx"]3; /* And so is this */
- > char x = 3["abcx"];
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-